package com.summer.main;


public class ThreadTest2 {
	public final static Object lock = new Object[0];
	public static void main(String[] args) {
			for(int i=0;i<=20;i++){
				Helper helper = new Helper("主线程");
				Thread thread = new Thread(helper);
				thread.setName("从线程"+i);
				thread.start();
			}
	}
	
	public static class Helper implements Runnable{
		private String msg;
		
		public Helper(String msg){
			this.msg = msg;
		}
		
		public  void run() {

//			synchronized(lock){
			System.out.println("从线程名："+Thread.currentThread().getName());
//			System.out.println("消息来自："+msg);
			

			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
//			}
		}
		
	}
	
}
